{
  "name": "Case 79 - Talent Acquisition - Passive Candidate Identifier",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -1200,
        -176
      ],
      "id": "3b037cc3-65e2-488b-ab81-cd226bc7b1ae",
      "name": "Weekly Schedule - Monday 9 AM"
    },
    {
      "parameters": {
        "actorId": {
          "__rl": true,
          "value": "buIWk2uOUzTmcLsuB",
          "mode": "list",
          "cachedResultName": "Linkedin Post Search Scraper (No Cookies) (harvestapi/linkedin-post-search)",
          "cachedResultUrl": "https://console.apify.com/actors/buIWk2uOUzTmcLsuB/input"
        },
        "customBody": "{\n  \"authorUrls\": [\n    \"https://www.linkedin.com/company/google\",\n    \"https://www.linkedin.com/company/microsoft\",\n    \"https://www.linkedin.com/company/meta\",\n    \"https://www.linkedin.com/company/amazon\",\n    \"https://www.linkedin.com/company/apple\"\n  ],\n  \"searchQueries\": [\n    \"burned out\",\n    \"looking for change\",\n    \"open to opportunities\",\n    \"what's next\",\n    \"seeking\",\n    \"new challenge\"\n  ],\n  \"maxPosts\": 50,\n  \"scrapeComments\": false,\n  \"scrapeReactions\": false\n}"
      },
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 1,
      "position": [
        -1008,
        -176
      ],
      "id": "99fa80f8-e221-4194-a690-2f3b3ccc4fc8",
      "name": "Scrape LinkedIn Passive Candidates",
      "credentials": {
        "apifyApi": {
          "id": "w5S6YBbbyUddEfQA",
          "name": "Apify account"
        }
      }
    },
    {
      "parameters": {
        "resource": "Datasets",
        "datasetId": "={{ $json.defaultDatasetId }}"
      },
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 1,
      "position": [
        -816,
        -176
      ],
      "id": "84cafa06-7336-437b-9133-db054d6e1318",
      "name": "Get Dataset Items",
      "credentials": {
        "apifyApi": {
          "id": "w5S6YBbbyUddEfQA",
          "name": "Apify account"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4o-mini"
        },
        "responses": {
          "values": [
            {
              "role": "system",
              "content": "=You are a Passive Candidate Signal Validation Expert.\n\nAnalyze LinkedIn posts to determine if they indicate genuine passive candidate signals (someone open to new opportunities).\n\nReturn ONLY valid JSON in this exact format:\n{\n  \"is_passive_candidate\": \"yes|no\",\n  \"confidence\": 0.95,\n  \"reason\": \"brief explanation\"\n}\n\nCriteria for \"yes\" (genuine passive candidate signal):\n✅ Expresses career dissatisfaction or burnout\n✅ Mentions \"looking for change\" or \"what's next\"\n✅ States \"open to opportunities\" explicitly\n✅ Describes seeking new challenges or growth\n✅ Discusses career crossroads or transitions\n✅ Mentions wanting better work-life balance\n✅ Expresses frustration with current role/company\n✅ Asks for career advice or recommendations\n\nCriteria for \"no\" (NOT a passive candidate):\n❌ Celebrating current job or company\n❌ Recently started new role (within 6 months)\n❌ Recruiter or HR posting about hiring\n❌ Giving career advice to others\n❌ Casual mention without actual job search intent\n❌ Student or recent grad seeking first job\n❌ Freelancer/consultant promoting services\n❌ Retired or not in workforce\n\nRules:\n1. confidence: 0-1 scale (0.9+ for very clear passive candidate signals)\n2. reason: 1 sentence explaining the decision\n3. Be strict - require actual job dissatisfaction or openness to change\n4. Return ONLY the JSON object, no explanations"
            },
            {
              "content": "=Analyze this LinkedIn post to determine if it's a passive candidate signal:\n\nAuthor: {{ $json.author.name }}\nAuthor Info: {{ $json.author.info }}\nPost Date: {{ $json.postedAt.date }}\nPost Content: {{ $json.content }}\n\nReturn only JSON."
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        -624,
        -176
      ],
      "id": "9ae67578-f88f-4751-b62b-2501070934e4",
      "name": "AI Validation Filter",
      "credentials": {
        "openAiApi": {
          "id": "ICwxUBbatsF2sDvy",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// UNIVERSAL AI RESPONSE PARSER - Same code for ALL cases\nconst items = [];\nconst input = $input.all();\n\nfunction extractJSON(text) {\n  const jsonMatch = text.match(/\\{[\\s\\S]*\\}/);\n  if (!jsonMatch) return null;\n  return jsonMatch[0];\n}\n\ninput.forEach((item, index) => {\n  try {\n    let aiText = item.json.output[0].content[0].text || '';\n    \n    // Clean markdown code blocks\n    aiText = aiText\n      .replace(/```json/gi, '')\n      .replace(/```/g, '')\n      .trim();\n    \n    // Extract JSON object\n    const jsonStr = extractJSON(aiText);\n    \n    if (!jsonStr) {\n      throw new Error('No JSON found in AI response');\n    }\n    \n    // Parse and return clean JSON\n    const parsed = JSON.parse(jsonStr);\n    items.push({ json: parsed });\n    \n  } catch (error) {\n    console.error(`Parse error for item ${index}:`, error.message);\n    // Return empty object on error - no case-specific fields\n    items.push({ json: {} });\n  }\n});\n\nreturn items;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -304,
        -176
      ],
      "id": "bc2cdbbb-bc10-4d33-9713-46a048baf8e6",
      "name": "Parse AI Validation"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "is_passive_candidate",
              "name": "is_passive_candidate",
              "value": "={{ $json.is_passive_candidate }}",
              "type": "string"
            },
            {
              "id": "confidence",
              "name": "confidence",
              "value": "={{ $json.confidence }}",
              "type": "number"
            },
            {
              "id": "reason",
              "name": "reason",
              "value": "={{ $json.reason }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -96,
        -176
      ],
      "id": "fb8738f5-caa2-49a0-aba7-02438eefaee8",
      "name": "Edit Fields - Validation"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "id": "condition-001",
              "leftValue": "={{ $json.is_passive_candidate }}",
              "rightValue": "yes",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2,
      "position": [
        96,
        -176
      ],
      "id": "f56e4ef2-f79a-4774-8861-a917316efaa0",
      "name": "Filter Only Passive Candidates"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4o-mini"
        },
        "responses": {
          "values": [
            {
              "role": "system",
              "content": "=You are a Talent Acquisition Intelligence Analyst.\n\nExtract structured passive candidate information from LinkedIn posts.\n\nReturn ONLY valid JSON in this exact format:\n{\n  \"candidate_name\": \"Person's name who posted\",\n  \"current_company\": \"Their current employer\",\n  \"current_role\": \"Their job title if mentioned or inferred from profile\",\n  \"dissatisfaction_reason\": \"Why they're unhappy or seeking change (max 150 chars)\",\n  \"skill_set\": [\"skill 1\", \"skill 2\", \"skill 3\"],\n  \"desired_next_role\": \"What type of role they want next (if mentioned)\",\n  \"location\": \"Their location if mentioned\",\n  \"poaching_difficulty\": \"Easy|Medium|Hard - based on signals\"\n}\n\nExtraction Rules:\n1. candidate_name: Extract from author info\n2. current_company: Extract from author profile\n3. current_role: Extract from author info or infer from post context\n4. dissatisfaction_reason: Summarize their pain points or reasons for wanting change\n5. skill_set: Extract skills mentioned or inferred from their role/industry\n6. desired_next_role: Extract if they mention what they're looking for (e.g., \"leadership role\", \"startup environment\")\n7. location: Extract city/region if mentioned\n8. poaching_difficulty: \n   - Easy = Explicitly open to opportunities, very dissatisfied\n   - Medium = Exploring options, some dissatisfaction\n   - Hard = Subtle hints, would need strong offer\n\nReturn ONLY the JSON object, no explanations."
            },
            {
              "content": "=Extract passive candidate intelligence from this LinkedIn post:\n\nAuthor: {{ $('Get Dataset Items').item.json.author.name }}\nAuthor Info: {{ $('Get Dataset Items').item.json.author.info }}\nPost Date: {{ $('Get Dataset Items').item.json.postedAt.date }}\nPost Content: {{ $('Get Dataset Items').item.json.content }}\nEngagement: {{ $('Get Dataset Items').item.json.engagement.likes }} likes, {{ $('Get Dataset Items').item.json.engagement.comments }} comments\n\nReturn only JSON."
            }
          ]
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2.1,
      "position": [
        272,
        -176
      ],
      "id": "768f7bb5-5eac-45c3-a953-4ae4014642f2",
      "name": "AI Extract Candidate Intelligence",
      "credentials": {
        "openAiApi": {
          "id": "ICwxUBbatsF2sDvy",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// UNIVERSAL AI RESPONSE PARSER - Same code for ALL cases\nconst items = [];\nconst input = $input.all();\n\nfunction extractJSON(text) {\n  const jsonMatch = text.match(/\\{[\\s\\S]*\\}/);\n  if (!jsonMatch) return null;\n  return jsonMatch[0];\n}\n\ninput.forEach((item, index) => {\n  try {\n    let aiText = item.json.output[0].content[0].text || '';\n    \n    // Clean markdown code blocks\n    aiText = aiText\n      .replace(/```json/gi, '')\n      .replace(/```/g, '')\n      .trim();\n    \n    // Extract JSON object\n    const jsonStr = extractJSON(aiText);\n    \n    if (!jsonStr) {\n      throw new Error('No JSON found in AI response');\n    }\n    \n    // Parse and return clean JSON\n    const parsed = JSON.parse(jsonStr);\n    items.push({ json: parsed });\n    \n  } catch (error) {\n    console.error(`Parse error for item ${index}:`, error.message);\n    // Return empty object on error - no case-specific fields\n    items.push({ json: {} });\n  }\n});\n\nreturn items;"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        560,
        -176
      ],
      "id": "5d2ba15a-5ce3-4fde-8696-b256c2157a11",
      "name": "Parse AI Response"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "timestamp",
              "name": "analysis_timestamp",
              "value": "={{ new Date().toISOString() }}",
              "type": "string"
            },
            {
              "id": "candidate_name",
              "name": "candidate_name",
              "value": "={{ $json.candidate_name }}",
              "type": "string"
            },
            {
              "id": "current_company",
              "name": "current_company",
              "value": "={{ $json.current_company }}",
              "type": "string"
            },
            {
              "id": "current_role",
              "name": "current_role",
              "value": "={{ $json.current_role }}",
              "type": "string"
            },
            {
              "id": "dissatisfaction",
              "name": "dissatisfaction_reason",
              "value": "={{ $json.dissatisfaction_reason }}",
              "type": "string"
            },
            {
              "id": "skills",
              "name": "skill_set",
              "value": "={{ $json.skill_set }}",
              "type": "array"
            },
            {
              "id": "desired_role",
              "name": "desired_next_role",
              "value": "={{ $json.desired_next_role }}",
              "type": "string"
            },
            {
              "id": "location",
              "name": "location",
              "value": "={{ $json.location }}",
              "type": "string"
            },
            {
              "id": "poaching",
              "name": "poaching_difficulty",
              "value": "={{ $json.poaching_difficulty }}",
              "type": "string"
            },
            {
              "id": "author_profile",
              "name": "author_profile",
              "value": "={{ $('Get Dataset Items').item.json.author?.linkedinUrl || '' }}",
              "type": "string"
            },
            {
              "id": "author_info",
              "name": "author_info",
              "value": "={{ $('Get Dataset Items').item.json.author?.info || '' }}",
              "type": "string"
            },
            {
              "id": "post_content",
              "name": "post_content",
              "value": "={{ $('Get Dataset Items').item.json.content || '' }}",
              "type": "string"
            },
            {
              "id": "post_date",
              "name": "post_date",
              "value": "={{ $('Get Dataset Items').item.json.postedAt?.date || '' }}",
              "type": "string"
            },
            {
              "id": "post_url",
              "name": "post_url",
              "value": "={{ $('Get Dataset Items').item.json.linkedinUrl || '' }}",
              "type": "string"
            },
            {
              "id": "likes",
              "name": "likes_count",
              "value": "={{ $('Get Dataset Items').item.json.engagement?.likes || 0 }}",
              "type": "number"
            },
            {
              "id": "comments",
              "name": "comments_count",
              "value": "={{ $('Get Dataset Items').item.json.engagement?.comments || 0 }}",
              "type": "number"
            },
            {
              "id": "shares",
              "name": "shares_count",
              "value": "={{ $('Get Dataset Items').item.json.engagement?.shares || 0 }}",
              "type": "number"
            },
            {
              "id": "total_engagement",
              "name": "engagement_total",
              "value": "={{ ($('Get Dataset Items').item.json.engagement?.likes || 0) + ($('Get Dataset Items').item.json.engagement?.comments || 0) + ($('Get Dataset Items').item.json.engagement?.shares || 0) }}",
              "type": "number"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        752,
        -176
      ],
      "id": "1c10b014-cb62-4c88-97fb-2d5ce84e7c3d",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1tebPFyKhMyif3pE330KGllYtPvpL8vXpEH_SStgYfzY",
          "mode": "list",
          "cachedResultName": "Case 79 - Passive Candidate Log",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tebPFyKhMyif3pE330KGllYtPvpL8vXpEH_SStgYfzY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tebPFyKhMyif3pE330KGllYtPvpL8vXpEH_SStgYfzY/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Analysis_Date": "={{ $json.analysis_timestamp }}",
            "Candidate_Name": "={{ $json.candidate_name }}",
            "Current_Company": "={{ $json.current_company }}",
            "Current_Role": "={{ $json.current_role }}",
            "Dissatisfaction_Reason": "={{ $json.dissatisfaction_reason }}",
            "Skill_Set": "={{ $json.skill_set.join('; ') }}",
            "Desired_Next_Role": "={{ $json.desired_next_role }}",
            "Location": "={{ $json.location }}",
            "Poaching_Difficulty": "={{ $json.poaching_difficulty }}",
            "Author_Profile": "={{ $json.author_profile }}",
            "Post_Date": "={{ $json.post_date }}",
            "Likes": "={{ $json.likes_count }}",
            "Comments": "={{ $json.comments_count }}",
            "Shares": "={{ $json.shares_count }}",
            "Total_Engagement": "={{ $json.engagement_total }}",
            "Post_URL": "={{ $json.post_url }}",
            "Post_Content": "={{ $json.post_content }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Analysis_Date",
              "displayName": "Analysis_Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Candidate_Name",
              "displayName": "Candidate_Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Current_Company",
              "displayName": "Current_Company",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Current_Role",
              "displayName": "Current_Role",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Dissatisfaction_Reason",
              "displayName": "Dissatisfaction_Reason",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Skill_Set",
              "displayName": "Skill_Set",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Desired_Next_Role",
              "displayName": "Desired_Next_Role",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Location",
              "displayName": "Location",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Poaching_Difficulty",
              "displayName": "Poaching_Difficulty",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Author_Profile",
              "displayName": "Author_Profile",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Post_Date",
              "displayName": "Post_Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Likes",
              "displayName": "Likes",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Comments",
              "displayName": "Comments",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Shares",
              "displayName": "Shares",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Total_Engagement",
              "displayName": "Total_Engagement",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Post_URL",
              "displayName": "Post_URL",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Post_Content",
              "displayName": "Post_Content",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        944,
        -176
      ],
      "id": "a03ac444-f454-48be-a12c-2942e414d22b",
      "name": "Log to Google Sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "LOs2dbk9lby0NfDM",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Aggregate all items from Google Sheets into email-ready summary\nconst allItems = $input.all();\n\n// Count by current company\nconst companyCounts = {};\nallItems.forEach(item => {\n  const company = item.json.Current_Company || 'Unknown';\n  companyCounts[company] = (companyCounts[company] || 0) + 1;\n});\n\nconst topCompanies = Object.entries(companyCounts)\n  .sort((a, b) => b[1] - a[1])\n  .slice(0, 10);\n\n// Count by poaching difficulty\nconst difficultyCounts = {};\nallItems.forEach(item => {\n  const difficulty = item.json.Poaching_Difficulty || 'Unknown';\n  difficultyCounts[difficulty] = (difficultyCounts[difficulty] || 0) + 1;\n});\n\n// Top skills mentioned\nconst skillCounts = {};\nallItems.forEach(item => {\n  const skillsString = item.json.Skill_Set || '';\n  if (skillsString) {\n    const skills = skillsString.split(';').map(s => s.trim()).filter(s => s);\n    skills.forEach(skill => {\n      skillCounts[skill] = (skillCounts[skill] || 0) + 1;\n    });\n  }\n});\n\nconst topSkills = Object.entries(skillCounts)\n  .sort((a, b) => b[1] - a[1])\n  .slice(0, 10);\n\n// Easy targets (low poaching difficulty)\nconst easyTargets = allItems.filter(item => \n  item.json.Poaching_Difficulty === 'Easy'\n);\n\n// Count by current role category\nconst roleCounts = {};\nallItems.forEach(item => {\n  const role = item.json.Current_Role || 'Unknown';\n  roleCounts[role] = (roleCounts[role] || 0) + 1;\n});\n\nconst topRoles = Object.entries(roleCounts)\n  .sort((a, b) => b[1] - a[1])\n  .slice(0, 10);\n\n// Build HTML table rows\nconst tableRows = allItems.map(item => {\n  const data = item.json;\n  const difficultyColor = data.Poaching_Difficulty === 'Easy' ? '#28a745' : \n                          data.Poaching_Difficulty === 'Medium' ? '#ffc107' : '#dc3545';\n  \n  return `\n    <tr>\n      <td>${data.Candidate_Name || 'N/A'}</td>\n      <td>${data.Current_Company || 'N/A'}</td>\n      <td>${data.Current_Role || 'N/A'}</td>\n      <td><span style=\"color: ${difficultyColor}; font-weight: bold;\">${data.Poaching_Difficulty || 'N/A'}</span></td>\n      <td>${data.Dissatisfaction_Reason || 'N/A'}</td>\n      <td><a href=\"${data.Post_URL || '#'}\">View</a></td>\n    </tr>\n  `;\n}).join('');\n\n// Return single aggregated item\nreturn {\n  json: {\n    week_start: new Date(Date.now() - 7*24*60*60*1000).toISOString().split('T')[0],\n    week_end: new Date().toISOString().split('T')[0],\n    total_candidates: allItems.length,\n    top_companies: topCompanies,\n    difficulty_breakdown: Object.entries(difficultyCounts),\n    top_skills: topSkills,\n    easy_targets_count: easyTargets.length,\n    top_roles: topRoles,\n    table_rows: tableRows,\n    all_candidates: allItems.map(item => item.json)\n  }\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1136,
        -176
      ],
      "id": "b59362d2-7c38-438a-9c66-70d035131274",
      "name": "Aggregate Weekly Summary"
    },
    {
      "parameters": {
        "sendTo": "talent-team@yourcompany.com",
        "subject": "=📊 Weekly Passive Candidate Report: {{ $json.week_start }} to {{ $json.week_end }}",
        "message": "=WEEKLY PASSIVE CANDIDATE INTELLIGENCE REPORT\n================================================\nReport Period: {{ $json.week_start }} to {{ $json.week_end }}\n\nOVERVIEW:\nTotal Passive Candidates Identified: {{ $json.total_candidates }}\nEasy Targets (Highly Motivated): {{ $json.easy_targets_count }}\n\nTOP SOURCE COMPANIES:\n{{ $json.top_companies.map(([company, count], i) => (i+1) + '. ' + company + ' (' + count + ' candidates)').join('\\n') }}\n\nPOACHING DIFFICULTY BREAKDOWN:\n{{ $json.difficulty_breakdown.map(([difficulty, count]) => difficulty + ': ' + count).join('\\n') }}\n\nTOP SKILLS IDENTIFIED:\n{{ $json.top_skills.slice(0, 10).map((skill, i) => (i+1) + '. ' + skill[0] + ' (' + skill[1] + ' mentions)').join('\\n') }}\n\nTOP ROLES:\n{{ $json.top_roles.slice(0, 10).map(([role, count], i) => (i+1) + '. ' + role + ' (' + count + ' candidates)').join('\\n') }}\n\n🎯 PRIORITY ACTION:\n{{ $json.easy_targets_count }} candidates showing strong signals - reach out this week!\n\nFull candidate details in Google Sheets.\n\nGenerated: {{ new Date().toLocaleDateString() }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        1328,
        -176
      ],
      "id": "f503dda1-4b0b-4937-b68a-c9f19df2d273",
      "name": "Send Weekly Summary Email",
      "webhookId": "c9924cde-fedb-4ddd-bc10-9d911ebd656e",
      "credentials": {
        "gmailOAuth2": {
          "id": "cyqCGWcggZNMcSOv",
          "name": "Gmail account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Weekly Schedule - Monday 9 AM": {
      "main": [
        [
          {
            "node": "Scrape LinkedIn Passive Candidates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape LinkedIn Passive Candidates": {
      "main": [
        [
          {
            "node": "Get Dataset Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Dataset Items": {
      "main": [
        [
          {
            "node": "AI Validation Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Validation Filter": {
      "main": [
        [
          {
            "node": "Parse AI Validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Validation": {
      "main": [
        [
          {
            "node": "Edit Fields - Validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields - Validation": {
      "main": [
        [
          {
            "node": "Filter Only Passive Candidates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Only Passive Candidates": {
      "main": [
        [
          {
            "node": "AI Extract Candidate Intelligence",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Extract Candidate Intelligence": {
      "main": [
        [
          {
            "node": "Parse AI Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Response": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Log to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Google Sheet": {
      "main": [
        [
          {
            "node": "Aggregate Weekly Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Weekly Summary": {
      "main": [
        [
          {
            "node": "Send Weekly Summary Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "42e45edd-c7d2-40da-af16-7f640c41335f",
  "meta": {
    "instanceId": "3a43da28588548e21903e71cf1dc3ddd65c24bf0c62e7e4b77542ffe87ad79c6"
  },
  "id": "FqeFiAWOcudrziEy",
  "tags": []
}